/**
 * Created by yqj on 2017/2/20.
 */
const mongoose = require('../db'),
    roleSchema = require('../schemas/role-schema.js');


//middleware
roleSchema.pre('save', function (next) {
    //做点什么
    next();
});

roleSchema.pre('update', function (next) {
    //做点什么
    next();
});

roleSchema.pre('remove', function (next) {
    //做点什么
    next();
});

roleSchema.pre('find', function (next) {
    //做点什么
    next();
});

const roleModel = mongoose.model('Role', roleSchema);

//roleModel.create([{
//    key: 'ROLE_OPERATOR_AYALIZE_MGT',
//    name: '运营人员:解析管理'
//},{
//    key: 'ROLE_OPERATOR_BASEINFO_INPUT',
//    name: '运营人员:信息录入'
//},{
//    key: 'ROLE_OPERATOR_CONTENT_MGT',
//    name: '运营人员:内容管理'
//},{
//    key: 'ROLE_PT_EDITOR',
//    name: '兼职编辑'
//},{
//    key: 'ROLE_PT_TEACHER',
//    name: '兼职教师'
//},{
//    key: 'ROLE_SUPER_ADMIN',
//    name: '超级用户'
//},{
//    key: 'ROLE_WINSHARE_OPERATOR_AYALIZE_MGT',
//    name: '文轩解析管理员'
//},{
//    key: 'ROLE_WINSHARE_PT_TEACHER',
//    name: '文轩兼职教师'
//},{
//    key: 'ROLE_WINSHARE_UNIFIED_DRAFTER',
//    name: '文轩统稿人'
//}], (err) => {
//    console.log(err);
//});
module.exports = roleModel;